package xzr;

class Animal{
    public String name;
    public int age;
    public void eat(){
        System.out.println(name+" 在吃饭");
    }
}

class Cat extends Animal{

    public void miao(){
        System.out.println(name+" 喵喵叫");
    }
}

class Dog extends Cat{

    public void wang(){
        System.out.println(name+" 旺旺叫");
    }
}


public class Test1 {
    public static void main(String[] args) {
        Animal animal = new Animal();
        Animal animal1 = new Dog();
        Animal animal2 = new Cat();

    }

    public static void main1(String[] args) {
        Cat cat1 = new Cat();
        cat1.name = "左左";
        cat1.eat();
        cat1.miao();


    }
}
